﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CXedu.Model;
using CXedu.Business;
using System.Collections;
using Ajeelee.Core.Utils;

namespace CXedu.WebSite
{
    public partial class train : System.Web.UI.Page
    {
        Hashtable table = new Hashtable();
        //焦点图片
        protected IList<PhotoImgs> photoImgsList = new List<PhotoImgs>();

        //课程试听
        protected IList<News> kcstNewsList = new List<News>();
        //招生动态
        protected IList<News> zsdtNewsList = new List<News>();
        //网上辅导
        protected IList<News> wsfdtNewsList = new List<News>();
        //医考资讯
        protected IList<News> ykzxNewsList = new List<News>();

        INewsBusiness newsBll = new NewsBusinessFactory().CreateNewsBusiness();
        IPhotoImgsBusiness photoBll = new PhotoImgsBusinessFactory().CreatePhotoImgsBusiness();

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //焦点图片
                table.Clear();
                table.Add("TopNum", 5);
                table.Add(PhotoImgsHash.CId, 2);
                table.Add(PhotoImgsHash.OrderField, "Sort");
                table.Add(PhotoImgsHash.OrderDirection, "asc");
                photoImgsList = photoBll.GetAllPhotoImgs(table);

                //课程试听
                table.Clear();
                table.Add("TopNum", 11);
                table.Add(NewsHash.CId, 16);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                kcstNewsList = newsBll.GetAllNews(table);

                //招生动态
                table.Clear();
                table.Add("TopNum", 11);
                table.Add(NewsHash.CId, 17);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                zsdtNewsList = newsBll.GetAllNews(table);

                //网上辅导
                table.Clear();
                table.Add("TopNum", 11);
                table.Add(NewsHash.CId, 18);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                wsfdtNewsList = newsBll.GetAllNews(table);

                //医考资讯
                table.Clear();
                table.Add("TopNum", 11);
                table.Add(NewsHash.CId, 19);
                table.Add(NewsHash.OrderField, "Top");
                table.Add(NewsHash.OrderDirection, "desc,N_Id desc");
                ykzxNewsList = newsBll.GetAllNews(table);
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}